#include "IODeviceWithoutThreadSupport.h"


IODeviceWithoutThreadSupport::IODeviceWithoutThreadSupport(IODeviceType type, IODeviceContext* context)
	: m_eType(type)
	, m_Context(context)
{
}


IODeviceWithoutThreadSupport::~IODeviceWithoutThreadSupport()
{

}

void IODeviceWithoutThreadSupport::AddEventListener(IODeviceEventListener* pListener) {
	if (pListener == NULL) {
		return;
	}
	m_vecListener.push_back(pListener);
}

IODeviceType IODeviceWithoutThreadSupport::GetType() {
	return m_eType;
}

void IODeviceWithoutThreadSupport::Notice(IODeviceType type, IODeviceOperation operation, unsigned int ptr) {
	BDVector<IODeviceEventListener*>::iterator it = m_vecListener.begin();
	for (; it != m_vecListener.end(); ++it) {
		if ((*it) != NULL) {
			(*it)->OnIODeviceEvent(type, operation, ptr);
		}
	}
}
